using System;
using System.Collections.Generic;
using SouthernLand.Common.DAL.Advertise;

namespace SouthernLand.Common.BOL.Advertise
{
    public class Advertise
    {
        #region Public Properties

        public Int32 AdvID { get; set; }

        public String FileName { get; set; }

        public Int32 AdvWidth { get; set; }

        public Int32 AdvHeight { get; set; }

        public String AdvURL { get; set; }

        public DateTime AddedDate { get; set; }

        public DateTime RegionDate { get; set; }

        public DateTime ExpireDate { get; set; }

        public Int32 ClickCount { get; set; }

        public Int32 CateID { get; set; }

        public Int32 AdvPosition { get; set; }

        public Int32 DisplayOrder { get; set; }

        public Boolean IsActive { get; set; }

        #endregion

        #region public static Methods

        public static List<Advertise> GetAdvertiseByPosition(int AdvPosition)
        {
            var db = new AdvertiseDAL();
            return db.GetAdvertiseByPosition(AdvPosition);
        }

        public static int Insert(Advertise obj)
        {
            var db = new AdvertiseDAL();
            return db.Insert(obj);
        }

        public static bool Update(Advertise obj)
        {
            var db = new AdvertiseDAL();
            return db.Update(obj);
        }

        public static bool Delete(Int32 AdvID)
        {
            var db = new AdvertiseDAL();
            return db.Delete(AdvID);
        }

        public static Advertise GetAdvertiseByID(Int32 AdvID)
        {
            var db = new AdvertiseDAL();
            return db.GetAdvertiseByID(AdvID);
        }

        //Get All Advertise
        public static List<Advertise> GetAllAdvertise()
        {
            var db = new AdvertiseDAL();
            return db.GetAllAdvertise(1, 10000);
        }

        //Get All Advertise
        public static List<Advertise> GetAllAdvertise(int PageIndex, int PageSize)
        {
            var db = new AdvertiseDAL();
            return db.GetAllAdvertise(PageIndex, PageSize);
        }

        // Get Count All records of Table  Advertise
        public static int GetCountAdvertise()
        {
            var db = new AdvertiseDAL();
            return db.GetCountAdvertise();
        }

        #endregion
    }
}